package com.gigmissions.client.ui;

import com.gigmissions.client.config.GigMissionsMessages;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FileUpload;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.inject.Inject;
import com.google.inject.Singleton;

@Singleton
public class UploadPictureForm extends FormPanel{
	
	@Inject
	public UploadPictureForm(GigMissionsMessages messages,HorizontalPanel container,Button browseButton,TextBox fileNameTextBox,FileUpload fileUpload){
		
		// Create a FormPanel and point it at a service.

		 //The /myFormHandler is a servlet
		 setAction("/myFormHandler");
		 
		 // Because we're going to add a FileUpload widget, we'll need to set the
		// form to use the POST method, and multipart MIME encoding.
		//VERY IMPORTANT when using FileUpload
		setEncoding(FormPanel.ENCODING_MULTIPART);
		setMethod(FormPanel.METHOD_POST);
		
		setWidget(container);
		
		//fileNameTextBox.setName("fileNameTextBox");
		//container.add(fileNameTextBox);
		//browseButton.setText(messages.browse());
		//container.add(browseButton);
		
		fileUpload.setName("uploadFormElement");
		container.add(fileUpload);
		
		
		
		
		
	}

}
